Device and Internet Status
Device and Internet Connection related commands.
Get Device ID
Returns a unique device ID.
Login required: No
CmdProc Code: OVS_CMD_GET_DEVICEID
Command number: 7
Input: Not required
Response: OVS_NOTIFY_GET_DEVICEID
- Success
- Failure
OVS_ERR_OK
data will contain
{
"device_id" : "unique_device_id"
}
data is null
Code sample:
- Java
- Kotlin
- JSON
VPNSDK.CommandNotifyCB callback = new VPNSDK.CommandNotifyCB() {
@Override
public void onNotify(int notification, int error, Object data) {
if (error == VPNSDK.OVS_ERROR_CODES.OVS_ERR_OK) {
// Do something when command is successful
} else {
// Process error
}
}
};
VPNSDK.CmdProc(VPNSDK.OVS_CMD_CODES.OVS_CMD_GET_DEVICEID, callback);
val callback = object : VPNSDK.CommandNotifyCB {
override fun onNotify(notification: Int, error: Int, data: Any?) {
if (error == VPNSDK.OVS_ERROR_CODES.OVS_ERR_OK) {
// Do something when command is successful
} else {
// Process error
}
}
}
VPNSDK.CmdProc(VPNSDK.OVS_CMD_CODES.OVS_CMD_GET_DEVICEID, callback)
VPNSDK.CmdProc("{\"cmd\": 7}");
Check AES Support
Checks whether the device's CPU natively supports AES encryption
Login required: No
CmdProc Code: OVS_CMD_CHECK_AES
Command number: 12
Input: Not required
Response: OVS_NOTIFY_CHECK_AES
- Success
- Failure
OVS_ERR_OK
data will contain
{
"AES_Support" : true|false
}
data is null
Code sample:
- Java
- Kotlin
- JSON
VPNSDK.CommandNotifyCB callback = new VPNSDK.CommandNotifyCB() {
@Override
public void onNotify(int notification, int error, Object data) {
if (error == VPNSDK.OVS_ERROR_CODES.OVS_ERR_OK) {
// Do something when command is successful
} else {
// Process error
}
}
};
VPNSDK.CmdProc(VPNSDK.OVS_CMD_CODES.OVS_CMD_CHECK_AES, callback);
val callback = object : VPNSDK.CommandNotifyCB {
override fun onNotify(notification: Int, error: Int, data: Any?) {
if (error == VPNSDK.OVS_ERROR_CODES.OVS_ERR_OK) {
// Do something when command is successful
} else {
// Process error
}
}
}
VPNSDK.CmdProc(VPNSDK.OVS_CMD_CODES.OVS_CMD_CHECK_AES, callback)
VPNSDK.CmdProc("{\"cmd\": 12}");
Check Internet Connection
Attempts to establish a connection to the back-end server. If connection fails, returns OVS_ERR_INTERNET_DISCONNECTED error.
Login required: No
CmdProc Code: OVS_CMD_CHECK_INTERNET
Command number: 6
Input: Not required
Response: OVS_NOTIFY_CHECK_INTERNET
- Success
- Failure
OVS_ERR_OK
data is null
OVS_ERR_INTERNET_DISCONNECTED
data is null
Code sample:
- Java
- Kotlin
- JSON
VPNSDK.CommandNotifyCB callback = new VPNSDK.CommandNotifyCB() {
@Override
public void onNotify(int notification, int error, Object data) {
if (error == VPNSDK.OVS_ERROR_CODES.OVS_ERR_OK) {
// Do something when command is successful
} else {
// Process error
}
}
};
VPNSDK.CmdProc(VPNSDK.OVS_CMD_CODES.OVS_CMD_CHECK_INTERNET, callback);
val callback = object : VPNSDK.CommandNotifyCB {
override fun onNotify(notification: Int, error: Int, data: Any?) {
if (error == VPNSDK.OVS_ERROR_CODES.OVS_ERR_OK) {
// Do something when command is successful
} else {
// Process error
}
}
}
VPNSDK.CmdProc(VPNSDK.OVS_CMD_CODES.OVS_CMD_CHECK_INTERNET, callback)
VPNSDK.CmdProc("{\"cmd\": 6}");
Check Open Port
Attempts to establish a connection to a specified host and port. Returns OVS_ERR_PORT_CLOSED error if connection fails.
Login required: No
CmdProc Code: OVS_CMD_CHECK_PORT
Command number: 8
Input:
{
"ip_addr": "167.71.173.88",
"proto": "tcp",
"port": 1194
}
Response: OVS_NOTIFY_CHECK_PORT
- Success
- Failure
OVS_ERR_OK
data is null
OVS_ERR_PORT_CLOSED
data is null
Code sample:
- Java
- Kotlin
- JSON
VPNSDK.CommandNotifyCB callback = new VPNSDK.CommandNotifyCB() {
@Override
public void onNotify(int notification, int error, Object data) {
if (error == VPNSDK.OVS_ERROR_CODES.OVS_ERR_OK) {
// Do something when command is successful
} else {
// Process error
}
}
};
VPNSDK.CmdProc(VPNSDK.OVS_CMD_CODES.OVS_CMD_CHECK_PORT, callback, "178.79.183.206", "tcp", "1194");
val callback = object : VPNSDK.CommandNotifyCB {
override fun onNotify(notification: Int, error: Int, data: Any?) {
if (error == VPNSDK.OVS_ERROR_CODES.OVS_ERR_OK) {
// Do something when command is successful
} else {
// Process error
}
}
}
VPNSDK.CmdProc(VPNSDK.OVS_CMD_CODES.OVS_CMD_CHECK_PORT, callback, "178.79.183.206", "tcp", "1194")
VPNSDK.CmdProc("{ \"cmd\": 8, \"data\": { \"ip_addr\": \"178.79.183.206\", \"proto\": \"tcp\", \"port\": 1194}}");
Get Ping
Attempts to establish a connection to a given VPN server and, if connection could be established, measures ping time.
Login required: No
CmdProc Code: OVS_CMD_GET_PING_RESULT
Command number: 11
Input:
{
"ip_addr": "104.192.3.90"
}
Response: OVS_NOTIFY_GET_PING_RESULT
- Success
- Failure
OVS_ERR_OK
data will contain the IP address and the response time in ms
{
"ip_addr": "104.192.3.90",
"time": 30
}
OVS_ERR_MISSING_PARAMS
OVS_ERR_WEB_API
data is null
Code sample:
- Java
- Kotlin
- JSON
VPNSDK.CommandNotifyCB callback = new VPNSDK.CommandNotifyCB() {
@Override
public void onNotify(int notification, int error, Object data) {
if (error == VPNSDK.OVS_ERROR_CODES.OVS_ERR_OK) {
// Do something when command is successful
} else {
// Process error
}
}
};
VPNSDK.CmdProc(VPNSDK.OVS_CMD_CODES.OVS_CMD_GET_PING_RESULT, callback, "104.192.3.90");
val callback = object : VPNSDK.CommandNotifyCB {
override fun onNotify(notification: Int, error: Int, data: Any?) {
if (error == VPNSDK.OVS_ERROR_CODES.OVS_ERR_OK) {
// Do something when command is successful
} else {
// Process error
}
}
}
VPNSDK.CmdProc(VPNSDK.OVS_CMD_CODES.OVS_CMD_GET_PING_RESULT, callback, "104.192.3.90")
VPNSDK.CmdProc("{\"cmd\": 11, \"data\" : { \"ip_addr\" : \"104.192.3.90\"}}");